<?php
require_once('db/check_login.php');
require_once('db/config.php');
$db=new db($config);
$userData=$db->foundOnebyWhere('user',"user='$_SESSION[user]'");//取得用户数据
$roleData=$db->foundOnebyWhere('user_role',"u_id='$userData[id]'");//取得角色数据
$columnsData=$db->fetchStrAll('c_id','role_columns',"r_id='$roleData[r_id]'");
$columnsData=array_unique($columnsData);
$columnsStr=implode(',',$columnsData);//把数组以逗号分割为字符串
$res=$db->foundbyWhere('columns',"id IN($columnsStr)ORDER BY sort ASC");
?>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style type="text/css">
        body {
            background-color: #39F;
            color:#FFF;
        }
    </style>
</head>

<body style="font-size:18px;">
<table width="100%" border="0">
    <?php foreach($res as $val):?>
        <tr>
            <td><a href="<?php echo $val['url']?>" target="right"><?php  echo $val['name'] ?></a></td>
        </tr>
    <?php endforeach;?>
</table>
</body>
</html>
